package com.java_foundation.huawei.Test_15;

import java.util.*;

/**
 * @program: java_foundation
 * @description:
 * @author: xiongbangwen <Email>xiongbangwen@163.com</Email>
 * @create: 2020-08-07 19:41
 **/
public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String str = sc.nextLine();
        str = str.replace("(", "").replace(")", "");
        String[] array = str.split(",");
        for (int i = 1; i <= array.length / 2; i++) {
            for (int k = 1; k < array.length / 2; k++) {
                if (Integer.parseInt(array[2 * k - 1]) < Integer.parseInt(array[2 * k + 1])) {
                    String temp = array[2 * k - 1];
                    String temp1 = array[2 * k - 2];
                    array[2 * k - 1] = array[2 * k + 1];
                    array[2 * k - 2] = array[2 * k];
                    array[2 * k + 1] = temp;
                    array[2 * k] = temp1;
                }
            }
        }
        Map map = new HashMap();
        StringBuffer result = new StringBuffer();
        for (int i = 0; i < array.length / 2; i++) {
            if (!map.containsKey(array[2 * i])) {
                result.append(array[2 * i] + ",");
                map.put(array[2 * i], array[2 * i + 1]);
            } else {
                if (!map.get(array[2 * i]).equals(array[2 * i + 1])) {
                    result.append(array[2 * i] + ",");
                }
            }

        }
        System.out.println(result.toString().substring(0, result.length() - 1));
    }
}